/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.notaria.guerrasalas.be;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author Administrador
 */
@Entity
@Table(name = "ACTO_JURIDICO_SIN_PARTICPANTES", catalog = "BASE_NOTARIAL", schema = "dbo")
@NamedQueries({@NamedQuery(name = "ActoJuridicoSinParticpantes.findAll", query = "SELECT a FROM ActoJuridicoSinParticpantes a"), @NamedQuery(name = "ActoJuridicoSinParticpantes.findByIdActoJuridico", query = "SELECT a FROM ActoJuridicoSinParticpantes a WHERE a.idActoJuridico = :idActoJuridico")})
public class ActoJuridicoSinParticpantes implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_ACTO_JURIDICO", nullable = false)
    private Long idActoJuridico;
    @OneToOne(cascade = CascadeType.ALL, mappedBy = "actoJuridicoSinParticpantes", fetch = FetchType.LAZY)
    private AperturaLibro aperturaLibro;
    @JoinColumn(name = "ID_ACTO_JURIDICO", referencedColumnName = "ID_ACTO_JURIDICO", nullable = false, insertable = false, updatable = false)
    @OneToOne(optional = false, fetch = FetchType.LAZY)
    private ActoJuridico actoJuridico;
    @OneToOne(cascade = CascadeType.ALL, mappedBy = "actoJuridicoSinParticpantes", fetch = FetchType.LAZY)
    private CartaNotarial cartaNotarial;

    public ActoJuridicoSinParticpantes() {
    }

    public ActoJuridicoSinParticpantes(Long idActoJuridico) {
        this.idActoJuridico = idActoJuridico;
    }

    public Long getIdActoJuridico() {
        return idActoJuridico;
    }

    public void setIdActoJuridico(Long idActoJuridico) {
        this.idActoJuridico = idActoJuridico;
    }

    public AperturaLibro getAperturaLibro() {
        return aperturaLibro;
    }

    public void setAperturaLibro(AperturaLibro aperturaLibro) {
        this.aperturaLibro = aperturaLibro;
    }

    public ActoJuridico getActoJuridico() {
        return actoJuridico;
    }

    public void setActoJuridico(ActoJuridico actoJuridico) {
        this.actoJuridico = actoJuridico;
    }

    public CartaNotarial getCartaNotarial() {
        return cartaNotarial;
    }

    public void setCartaNotarial(CartaNotarial cartaNotarial) {
        this.cartaNotarial = cartaNotarial;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idActoJuridico != null ? idActoJuridico.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ActoJuridicoSinParticpantes)) {
            return false;
        }
        ActoJuridicoSinParticpantes other = (ActoJuridicoSinParticpantes) object;
        if ((this.idActoJuridico == null && other.idActoJuridico != null) || (this.idActoJuridico != null && !this.idActoJuridico.equals(other.idActoJuridico))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.notaria.guerrasalas.be.ActoJuridicoSinParticpantes[idActoJuridico=" + idActoJuridico + "]";
    }

}
